home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / Digital Signatures / Digital Signature Demo / Source ƒ / SystemSupportsAOCE.c < prev   
Encoding:
C/C++ Source or Header  |  1993-06-11  |  1.2 KB  |  43 lines  |  [TEXT/KAHL]

  1. /*
  2.  * SystemSupportsAOCE.c
  3.  *
  4.  * Copyright © 1993, Apple Computer Inc.
  5.  * All rights reserved.
  6.  *
  7.  * This function calls Gestalt and returns noErr if this
  8.  * Macintosh supports the AOCE toolbox and the toolbox
  9.  * is available. Other interesting errors are:
  10.  *    gestaltUndefSelectorErr        AOCE Toolbox is not installed.
  11.  *    kOCEToolboxNotOpen            AOCE Toolbox is installed,
  12.  *                                but disabled (you must re-enable
  13.  *                                the toolbox in the AOCE setup
  14.  *                                control panel and reboot to
  15.  *                                enable it.
  16.  *
  17.  * Note: your application will surely crash if you call any
  18.  * AOCE function if this function returns an error.
  19.  */
  20.  
  21. #include <GestaltEqu.h>
  22. #include <OCE.h>
  23. #include <OCEErrors.h>
  24.  
  25. OSErr                        SystemSupportsAOCE(void);
  26.  
  27. /*
  28.  * Return noErr                        Installed and available.
  29.  * Return kOCEToolboxNotOpen         Installed, but not available,
  30.  * Return gestaltUndefSelectorErr    Not present on this machine
  31.  */
  32. OSErr
  33. SystemSupportsAOCE(void)
  34. {
  35.         long                    gestaltResponse;
  36.         OSErr                    status;
  37.         
  38.         status = Gestalt(gestaltOCEToolboxAttr, &gestaltResponse);
  39.         if (status == noErr
  40.          && (gestaltResponse & gestaltOCETBAvailable) == 0)
  41.             status = kOCEToolboxNotOpen;
  42.         return (status);
  43. }